package com.lantosec.hmrp.modules.notify.service;

import com.google.gson.JsonObject;
import com.lantosec.hmrp.modules.notify.entity.NotifyInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lantosec.hmrp.modules.notify.entity.NotifyRecipient;
import com.lantosec.hmrp.modules.notify.vo.NotifyInfoVO;
import com.lantosec.hmrp.modules.notify.vo.NotifyTypeVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 通知 服务类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-22
 */
public interface INotifyInfoService extends IService<NotifyInfo> {


    void saveNotifyInfo(NotifyInfoVO notifyInfoVO);

    /**
     * 查询未读通知
     * @param notifyTypeId
     * @return
     */
    List<NotifyInfoVO> getNotRead(String notifyTypeId);

    /**
     * 查询未读通知数量
     * @return
     */
    int countNotRead(String userId, String notifyTypeId);

    /**
     * 查询已读通知
     * @param notifyTypeId
     * @return
     */
    List<NotifyInfoVO> getRead(String notifyTypeId);

    /**
     * 更新为已读(参数为notify_id，read_mode)
     * @param notifyRecipientList
     */
    void updateRead(List<NotifyRecipient> notifyRecipientList);

    /**
     * 更新为删除(参数为notify_id,read_mode)
     * @param notifyRecipientList
     */
    void updateDelete(List<NotifyRecipient> notifyRecipientList);

    /**
     * app端查询通知类型列表
     * @return
     */
    List<NotifyTypeVO> getAll();

    /**
     * app端查询已读未读列表
     * @param notifyTypeId
     * @return
     */
    List<NotifyInfoVO> get(String notifyTypeId);

    /**
     * 登录显示系统公告
     * @return
     */
    List<NotifyInfoVO> getPublicRead();

    /**
     * 查询系统公告
     * @return
     */
    List<NotifyInfoVO> getPublicReadAll();

    /**
     * 预警发送通知
     * @param notifyInfoVO
     */
    void noticeSending(NotifyInfoVO notifyInfoVO);

    /**
     * 查询通知已读未读人数
     * @param notifyId
     * @return
     */
    Map<String, Object> getNotifySum(String notifyId);
}
